package com.zhongfl.crm.lixiao.batch.jobs;

import com.zhongfl.crm.lixiao.batch.service.OrderSyncFromLX2BossService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 从励销同步客户订单到BOSS
 *
 * @author wang.yuchuan
 * @date 2018/6/26
 */
@Component
@Slf4j
public class OrderSyncFromLX2BossJob extends JobService {

    @Resource
    private OrderSyncFromLX2BossService orderSyncFromLX2BossService;

    @Override
    public boolean lock() {
        return true;
    }

    @Override
    public void start() throws Exception {
        log.info("励销订单同步任务开始");

        orderSyncFromLX2BossService.newOrderSync();

        log.info("励销订单同步任务完成");

        log.info("励销订单更新任务开始");

        orderSyncFromLX2BossService.changeOrderSync();

        log.info("励销订单更新任务完成");
    }
}
